package assist.client.gwt.view.ui;


import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.Widget;

public class ShowStatsViewImpl extends StatsViewImpl implements ShowStatsView
{
    @UiField HasText titleText;
    @UiField HasClickHandlers editStatsLink;
    
    @UiField (provided=true)
    StatsTable statsTable;   
    private Presenter listener;

    public ShowStatsViewImpl(UiBinder<Widget, ShowStatsViewImpl> binder) 
    {
        statsTable = new StatsTable();
        initWidget(binder.createAndBindUi(this));
    }


    @UiHandler("editStatsLink")
    void onClickSelectStats(ClickEvent e)
    {
        listener.goToSelectStats();
    }

    @Override
    public void setPresenter(Presenter listener)
    {
        this.listener = listener;
        this.setStatsProvider(listener.getStatsProvider());
    }


    @Override
    protected StatsTable getStatsTable()
    {
        // TODO Auto-generated method stub
        return this.statsTable;
    }
}
